<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>容器居中对齐</title>
  <style>
    *{
      padding:0px;
      margin: 0px;
    }
    #top,#bottom{
      background: #aaa;
      height:150px;
    }
    #content {
      background: #eee;
      height:700px;
    }
    #top_center,#content_center,#bottom_center {
      border:1px solid red;
      width: 1100px;
      height:100%;
      margin:auto;
      /* position: relative;
      left:50%;
      margin-left:-550px; */
    }
  </style>
</head>
<body>
  <div id="top">
    <div id="top_center">
      顶部内容
    </div>
  </div>
  <div id="content">
    <div id="content_center">
      主要内容
    </div>
  </div>
  <div id="bottom">
    <div id="bottom_center">
      <p align="center">测试</p>
    </div>
  </div>
</body>
</html>